{% load i18n static %}<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
{% comment %} Eric: 强制webkit {% endcomment %}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit" />
<meta name="force-rendering" content="webkit"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
{% comment %} Eric: 强制webkit end {% endcomment %}

<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}?v=11{% endblock %}">
{% block extrastyle %}{% endblock %}
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}">{% endif %}

{% comment %} Eric: 注入自定义css, jq每个页面都需要 {% endcomment %}
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/xbase.css' %}?v=2021012701">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/noty@3.1.4/lib/noty.css">

<script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/jquery.init.js' %}"></script>
<script src="//cdn.jsdelivr.net/npm/noty@3.1.4/lib/noty.min.js"></script>
{% comment %} Eric: 注入自定义css, jq每个页面都需要 end {% endcomment %}

{% block extrahead %}{% endblock %}
{% block responsive %}
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}">
    {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive_rtl.css" %}">{% endif %}
{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE">{% endblock %}
</head>
{% load i18n %}

<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"
  data-admin-utc-offset="{% now "Z" %}">

<!-- Container -->
<div id="container">

    {% if not is_popup %}

{% comment %} Eric: 增加侧边栏1 {% endcomment %}
{% if has_sidebar %}
<div id="x-header">
{% endif %}
{% comment %} Eric: 增加侧边栏1 end {% endcomment %}

    <!-- Header -->
    <div id="header">
        <div id="branding">
        {% block branding %}{% endblock %}
        </div>
        {% block usertools %}
        {% if has_permission %}
        <div id="user-tools">
            {% block welcome-msg %}
                {% trans 'Welcome,' %}
                <strong>{% firstof user.get_short_name user.get_username %}</strong>.
            {% endblock %}
            {% block userlinks %}
                {% if site_url %}
                    <a href="{{ site_url }}">{% trans 'View site' %}</a> /
                {% endif %}
                {% if user.is_active and user.is_staff %}
                    {% url 'django-admindocs-docroot' as docsroot %}
                    {% if docsroot %}
                        <a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
                    {% endif %}
                {% endif %}
                {% if user.has_usable_password %}
                <a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
                {% endif %}
                <a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
            {% endblock %}
        </div>
        {% endif %}
        {% endblock %}
        {% block nav-global %}{% endblock %}
    </div>
    <!-- END Header -->

{% comment %} Eric: 增加侧边栏2 {% endcomment %}
{% if has_sidebar %}
</div>
<div class="x-header-fixed"></div>
{% include "admin/sidebar.html" %}
<div id="x-content">
{% endif %}
{% comment %} Eric: 增加侧边栏2 end {% endcomment %}

    {% block breadcrumbs %}
    <div class="breadcrumbs">
    <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
    {% if title %} &rsaquo; {{ title }}{% endif %}
    </div>
    {% endblock %}
    {% endif %}

    {% block messages %}
        {% comment %} {% if messages %}
        <ul class="messagelist">{% for message in messages %}
        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
        {% endfor %}</ul>
        {% endif %} {% endcomment %}
    {% endblock messages %}

    <!-- Content -->
    <div id="content" class="{% block coltype %}colM{% endblock %}">
        {% block pretitle %}{% endblock %}

        {% comment %} Eric: 去除content标题 {% endcomment %}
        {% comment %} {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %} {% endcomment %}
        {% comment %} Eric: 去除content标题 end {% endcomment %}

        {% block content %}
        {% block object-tools %}{% endblock %}
        {{ content }}
        {% endblock %}
        {% block sidebar %}{% endblock %}
        <br class="clear">
    </div>
    <!-- END Content -->

    {% block footer %}<div id="footer"></div>{% endblock %}

{% comment %} Eric: 增加侧边栏3 {% endcomment %}
{% if has_sidebar %}
{% if not is_popup %}
</div>
{% endif %}
{% endif %}
{% comment %} Eric: 增加侧边栏3 end {% endcomment %}

</div>
<!-- END Container -->
{% if has_sidebar %}
<script type="text/javascript" src="{% static 'admin/js/sidebar.js' %}?v=1"></script>
{% endif %}
{% if messages %}
<script>
    (function ($) {
        $(function () {
            Noty.setMaxVisible(10);
            {% for message in messages %}
            var options = {theme: 'metroui', type: '{{ message.tags }}', layout: 'topRight', text: '{{ message|capfirst }}', closeWith: ['click']};
        {% if message.tags != 'error' %}
            options['timeout'] = '5000';
            options['progressBar'] = true;
            {% endif %}
            new Noty(options).show();
            {% endfor %}
        });
    })(django.jQuery)
</script>
{% endif %}
</body>
</html>
